import axios from '@/utils/axios'

export const getMenu = (id: number): Promise<ApiResult<BaseMenu>> => {
    return axios.get(`base/menu/${id}`)
}

export const getMenuList = (): Promise<ApiResult<Array<BaseMenu>>> => {
    return axios.get(`base/menu/list`)
}

export const postAndPutMenu = (data: BaseMenu): Promise<ApiResult<null>> => {
    return axios.post(`base/menu`, data)
}

export const deleteMenu = (id: number): Promise<ApiResult<null>> => {
    return axios.delete(`base/menu/${id}`)
}

export const getMenuListByAppId = (appId: number): Promise<ApiResult<Array<BaseMenuVO>>> => {
    return axios.get(`base/menu/list/${appId}`)
}